//
//  FeedbackViewController.m
//  DigitalCampus
//
//  Created by 刘占宇 on 16/5/15.
//  Copyright © 2016年 刘占宇. All rights reserved.
//

#import "FeedbackViewController.h"

@interface FeedbackViewController ()<UITextViewDelegate> {
    NSMutableDictionary *Parameter_Dic;
}

@property (nonatomic, strong) SZTextView *textView;

@end

@implementation FeedbackViewController

- (NSString *)setNavTitle{
    return @"意见反馈";
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setUI];
}

- (void)setUI{
    _textView = [[SZTextView alloc] initWithFrame:CGRectMake(20, 0, Main_Screen_Width - 40, 300)];
    _textView.delegate = self;
    _textView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    _textView.backgroundColor = [UIColor clearColor];
    _textView.font = [UIFont systemFontOfSize:15.0f];
    _textView.placeholder = @"请输入反馈意见";
    _textView.scrollEnabled = NO;
    _textView.showsVerticalScrollIndicator = NO;
    _textView.showsHorizontalScrollIndicator = NO;
    _textView.layer.masksToBounds = YES;
    _textView.layer.cornerRadius = 4;
    _textView.layer.borderWidth = 0.5;
    _textView.layer.borderColor = LineColor.CGColor;
    [self.view addSubview:_textView];
}

- (UIButton *)set_rightButton{
    UIButton *button = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 28, 20.5)];
    [button setTitle:@"提交" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    button.titleLabel.font = AdaptedFontSize(12);
    return button;
}

- (void)right_button_event:(UIButton *)sender{
    [LZYNetworkHelper GET:feedbackadd parameters:@{@"content":_textView.text} success:^(id responseObject) {
        [LZYShowMsg showText:@"反馈成功！"];
        [self.navigationController popViewControllerAnimated:YES];
    } failure:^(NSError *error) {
        
    } showHub:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
